/*
 * @Descripttion: |
 * @version: 1.0
 * @Author: 王娆
 * @Date: 2020-09-02 20:23:09
 * @LastEditors: 王娆
 * @LastEditTime: 2020-09-04 14:30:35
 */
import fetch from '../utils/request'
export const loginUrl = (data) => {
    let {username,password} = data ;
    let encode = 'Basic ' + btoa(encodeURI(username + ':' + password))
    return fetch.get('/v1/token',{
        headers: {
            authorization: encode
        }
    })
}

export const registerUrl = (data) =>{
    return fetch.post('/v1/registry',data)
}

export const repeatUsername = (username) => {
    return fetch.get(`/v1/registry/${username}`)
}